package rents.jms_client;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import rents.RentConfirmation;

public class RentConfirmationLogger {
	
	
	private static final Log logger = LogFactory.getLog(RentConfirmationLogger.class);

	private List<RentConfirmation> confirmations = new ArrayList<RentConfirmation>();

	public void log(RentConfirmation rewardConfirmation) {
		this.confirmations.add(rewardConfirmation);
		if (logger.isInfoEnabled()) {
			logger.info("received confirmation: " + rewardConfirmation);
		}
	}

	public List<RentConfirmation> getConfirmations() {
		return Collections.unmodifiableList(confirmations);
	}

}
